<?php

namespace App\Http\Controller\Test;

use Swoft\Http\Server\Annotation\Mapping\Controller;
use Swoft\Http\Server\Annotation\Mapping\RequestMapping;
use Swoft\Http\Server\Annotation\Mapping\RequestMethod;

/**
 * Class WebsocketController
 * @Controller(prefix="/websocket")
 */
class WebsocketController extends BaseController {

    /**
     * swoftcli run -c ws:start [后台启动websocket服务]
     * @RequestMapping()
     */
    public function index(){
        $data = [
            'user_send' => 'User send message example',
            'server_reply' => 'Server reply message example'
        ];

        // 将会渲染 `resource/views/websocket/index.php` 文件
        return view('websocket/index', $data);
    }

    /**
     * swoftcli run -c ws:start [后台启动websocket服务]
     * @RequestMapping()
     */
    public function chat(){


        return view('chat/index');
    }

}